<?

class VPalinsesto_vidwiz extends View_vidwiz
{

    /**
     * Ritorna il tpl del menu per la creazione del palinsesto
     * @param array $lastVideos i dati iniziali da inserire nella pagina di creazione del palinsesto
     * @return string il tpl del menu upload_page
     */
    public function getPalinsestoCreationPage($lastVideos,$categories,$username,$nextPagination){
        $debug = USingleton_vidwiz::getInstances("UDebug_vidwiz");
        global $config;
        $model = USingleton_vidwiz::getInstances("Model_vidwiz");
        $this->assignVar("data", $lastVideos);
        $this->assignVar("categories",$categories);
        if($nextPagination == "1")
            $nextPagination = "true";
        else
            $nextPagination = "false";
        $this->assignVar("nextPagination",$nextPagination);
        $this->assign("maxRow","4");
        $results = $this->getResultsVideosSearchPalinsesto($lastVideos);
        $this->assignVar("palinsestoResults",$results);
        
        $menu = $this->fetchTpl('vidwiz_vid_palinsesto_page');
        
        return $menu;
    }
    
    /**
     *
     * @param array $videos i video da inserire nel template
     * @return string il tempalte contenente i video passati
     */
    public function getResultsVideosSearchPalinsesto($videos){
        $this->assignVar("data", $videos);
        $this->assign("maxRow","4");
        return $this->fetchTpl('vidwiz_vid_palinsesto_results');
    }
    
        /**
     *
     * @param array $videos i video da inserire nel template
     * @return string il tempalte contenente i video passati
     */
    public function getResultsVideosSearchHome($videos){
        $this->assignVar("data", $videos);
        $this->assign("maxRow","6");
        return $this->fetchTpl('vidwiz_vid_home_results');
    }
    
    /**
     * Ritorna il tpl del frontend del palinsesto
     * @param array $video
     * @param array $palinsesto
     * @return string Il tpl con i campi riempiti 
     */
    public function getPalinsestoFrontend($video,$palinsesto){
        $debug = USingleton_vidwiz::getInstances("UDebug_vidwiz");
        $this->assignVar("data",$video);
        $this->assignVar("pal",$palinsesto);
        if($video[0]['breaking'] == "1" )
            $this->assignVar("breaking","true");
        else $this->assignVar("breaking","false");
        return $this->fetchTpl('vidwiz_vid_palinsesto_frontend');
    }

    public function getHomePage($lastVideos,$categories,$nextPagination){
        $debug = USingleton_vidwiz::getInstances("UDebug_vidwiz");
        global $config;
        $model = USingleton_vidwiz::getInstances("Model_vidwiz");
        $this->assignVar("data", $lastVideos);
        $this->assignVar("categories",$categories);
        if($nextPagination == 1)
            $nextPagination = "true";
        else
            $nextPagination = "false";
        $this->assignVar("nextPagination",$nextPagination);
        $this->assign("maxRow","6");
        $results = $this->getResultsVideosSearchHome($lastVideos);
        $this->assignVar("data",$lastVideos);
        $menu = $this->fetchTpl('vidwiz_vid_home');
        return $menu;
    }


} // end of VPalinsesto
?>
